#include <boost/test/unit_test.hpp>

#include "reservation.h"

using namespace aviation;
using namespace std;

BOOST_AUTO_TEST_CASE(TestReservationConstructor)
{
	// Constructs an object with an appropriate string 
	Flight f("AB123 01012012 0915 AAC DAA 200 20");
	Customer c(string("Mr"),string("Tim"),string("Smith"),string("ClevertontownBath"),string("BAC123456"),string("074597612"));

	Reservation reservation1(f, c, Reservation::STANDARD_CLASS);

	BOOST_REQUIRE(reservation1.GetCustomerID() == c.GetID());
	BOOST_REQUIRE(reservation1.GetFlightID() == f.GetID());
	BOOST_REQUIRE(reservation1.GetReservationStatus() == Reservation::STANDARD_CLASS);

}

BOOST_AUTO_TEST_CASE(TestReservationCopyConstructor)
{

	Flight f("AB123 01012012 0915 AAC DAA 200 20");
	Customer c(string("Mr"),string("Tim"),string("Smith"),string("ClevertontownBath"),string("BAC123456"),string("074597612"));

	Reservation reservation1(f, c, Reservation::STANDARD_CLASS);
	Reservation reservation2(reservation1);

	BOOST_REQUIRE(reservation1 == reservation2);
}

BOOST_AUTO_TEST_CASE(TestReservationAssignmentOperator)
{
    Flight f("AB123 01012012 0915 AAC DAA 200 20");
	Customer c(string("Mr"),string("Tim"),string("Smith"),string("ClevertontownBath"),string("BAC123456"),string("074597612"));

	Reservation reservation1(f, c, Reservation::STANDARD_CLASS);
	Reservation reservation2;

	reservation2 = reservation1;

	BOOST_REQUIRE(reservation1 == reservation2);
}

BOOST_AUTO_TEST_CASE(TestReservationComparisonEqualOperator)
{
	Flight f1("AB123 01012012 0915 AAC DAA 200 20");
	Customer c1(string("Mr"),string("Tim"),string("Smith"),string("ClevertontownBath"),string("BAC123456"),string("074597612"));
	Reservation reservation1(f1, c1, Reservation::STANDARD_CLASS);

	Flight f2("AB123 01012012 0915 AAC DAA 200 20");
	Customer c2(string("Mr"),string("Tim"),string("Smith"),string("ClevertontownBath"),string("BAC123456"),string("074597612"));
	Reservation reservation2(f2, c2, Reservation::STANDARD_CLASS);

	BOOST_REQUIRE(reservation1 == reservation2);
}

BOOST_AUTO_TEST_CASE(TestReservationComparisonNotEqualOperator)
{
	//Returns true if they are not the same, or false if they are
	Flight f1("AB123 01012012 0915 AAC DAA 200 20");
	Customer c1(string("Mr"),string("Bromance"),string("McBropherson"),string("ClevertontownBath"),string("BAC123456"),string("054597612"));
	Reservation reservation1(f1, c1, Reservation::STANDARD_CLASS);

	Flight f2("AB123 01012012 0915 AAC DAA 200 20");
	Customer c2(string("Professor"),string("Tim"),string("Smith"),string("ClevertontownBath"),string("BAC123456"),string("074597612"));
	Reservation reservation2(f2, c2, Reservation::STANDARD_CLASS);

	BOOST_REQUIRE(reservation1 != reservation2);
}

BOOST_AUTO_TEST_CASE(TestReservationGetCustomerID)
{
	//Returns CustomerID
	Flight f("AB123 01012012 0915 AAC DAA 200 20");
	Customer c(string("Mr"),string("Tim"),string("Smith"),string("ClevertontownBath"),string("BAC123456"),string("074597612"));

	Reservation reservation1(f, c, Reservation::STANDARD_CLASS);

	BOOST_REQUIRE(reservation1.GetCustomerID() == c.GetID());


}

BOOST_AUTO_TEST_CASE(TestReservationGetFlighID)
{
	//Returns FlightID
	Flight f("AB123 01012012 0915 AAC DAA 200 20");
	Customer c(string("Mr"),string("Tim"),string("Smith"),string("ClevertontownBath"),string("BAC123456"),string("074597612"));

	Reservation reservation1(f, c, Reservation::STANDARD_CLASS);

	BOOST_REQUIRE(reservation1.GetFlightID() == f.GetID());


}